﻿<cfsilent>
	<cfscript>
	
		sql = "	SELECT
					c.sbj_id,
					c.grade,
					c.con_id,
					c.credit,
					c.credit_required,
					c.credit_optional,
					c.credit_relish,
					c.period,
					c.period_required,
					c.period_optional
				FROM
					t_condition c
				WHERE
					c.con_id = :conditionId ";
		
		queryObj = new Query(datasource = application.dnsSlave);
		queryObj.addParam(name = "conditionId", value = event.getArg("Schema"), cfsqltype = "cf_sql_varchar");
		rs_conditionEntity = queryObj.execute(sql = sql).getResult();

		sql = "	SELECT
					sbj.sbj_id,
					sbj.sbj_name,
					sbj.term_start,
					sbj.level_code,
					lb.learning_branch
				FROM
					t_subject sbj 
					INNER JOIN t_learning_branch lb ON sbj.b_id = lb.b_id
				WHERE
					sbj.sbj_id = :subjectId ";

		queryObj = new Query(datasource = application.dnsSlave);
		queryObj.addParam(name = "subjectId", value = rs_conditionEntity.sbj_id, cfsqltype = "cf_sql_varchar");
		rs_subjectEntity = queryObj.execute(sql = sql).getResult();

		sql = "	SELECT
					DISTINCT s.term_index
				FROM
					t_schema s
				WHERE
					s.grade = :grade 
					AND
					s.sbj_id = :subjectID 
				ORDER BY
					s.term_index";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="subjectID", value = event.getArg("SubID"), cfsqltype="cf_sql_varchar" );
		queryObj.addParam( name="grade", value = event.getArg("Edition"), cfsqltype="cf_sql_char" );
        rs_term = queryObj.execute( sql=sql ).getResult();

		sql = "	SELECT
					DISTINCT sbj.sbj_id,sbj.sbj_name
				FROM
					t_schema s
					INNER JOIN t_subject sbj ON sbj.sbj_id = s.sbj_id
				WHERE
					s.grade = :grade 
					AND
					(
					   s.sbj_id = :subjectId 
					   OR
					   s.sbj_id LIKE :subjectDir 
					)
					AND
					   SUBSTR(s.shm_prop,1,1) = '1'
				ORDER BY
					sbj.sbj_id";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="subjectId", value = event.getArg("SubID"), cfsqltype="cf_sql_varchar" );
		queryObj.addParam( name="grade", value = event.getArg("Edition"), cfsqltype="cf_sql_char" );
		queryObj.addParam( name="subjectDir", value = event.getArg("SubID") & "_", cfsqltype="cf_sql_varchar" );
        rs_subjectDegree = queryObj.execute( sql = sql ).getResult();
		
		sql = "	SELECT
					DISTINCT sbj.sbj_id,sbj.sbj_name
				FROM
					t_schema s
					INNER JOIN t_subject sbj ON sbj.sbj_id = s.sbj_id
				WHERE
					s.grade = :grade 
					AND
					(
					   s.sbj_id = :subjectId 
					   OR
					   s.sbj_id LIKE :subjectDir 
					)
					AND
					   SUBSTR(s.shm_prop,2,1) = '1'
				ORDER BY
					sbj.sbj_id";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="subjectId", value = event.getArg("SubID"), cfsqltype="cf_sql_varchar" );
		queryObj.addParam( name="grade", value = event.getArg("Edition"), cfsqltype="cf_sql_char" );
		queryObj.addParam( name="subjectDir", value = event.getArg("SubID") & "_", cfsqltype="cf_sql_varchar" );
        rs_secDegree = queryObj.execute( sql=sql ).getResult();

		sql = "	SELECT
					DISTINCT sbj.sbj_id,sbj.sbj_name
				FROM
					t_schema s
					INNER JOIN t_subject sbj ON sbj.sbj_id = s.sbj_id
				WHERE
					s.grade = :grade 
					AND
					(
					   s.sbj_id = :subjectId 
					   OR
					   s.sbj_id LIKE :subjectDir 
					)
					AND
					   SUBSTR(s.shm_prop,3,1) = '1'
				ORDER BY
					sbj.sbj_id";
		
		queryObj = new Query( datasource=application.dnsSlave );
		queryObj.addParam( name="subjectId", value = event.getArg("SubID"), cfsqltype="cf_sql_varchar" );
		queryObj.addParam( name="grade", value = event.getArg("Edition"), cfsqltype="cf_sql_char" );
		queryObj.addParam( name="subjectDir", value = event.getArg("SubID") & "_", cfsqltype="cf_sql_varchar" );
		rs_assistDegree = queryObj.execute( sql=sql ).getResult();

		

		event.setArg("pageTitle", "教学运行基础数据 - 培养方案");

		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		mathAdvice = getProperty("serviceFactory").getBean("senateMathAdvice");

		targetArgs = structNew();
		structInsert(targetArgs, "Edition", rs_conditionEntity.grade, true);
		structInsert(targetArgs, "SubID", rs_subjectEntity.sbj_id, true);
		structInsert(targetArgs, "Schema", rs_conditionEntity.con_id, true);

		currentTab = event.getArg("TabID", "labCondition");
		
		/* 将学期转换为学年 */
		termYearArray = arrayNew(1);
		
		for(a = 1; a LTE rs_term.recordCount; a++){
			termYear = mathAdvice.convertTermIdxToTermYear(rs_term['term_index'][a]);
			if ( termYear neq "" and not arrayFind(termYearArray, termYear) ) {
				arrayAppend(termYearArray, termYear);
			}	
		}
	
	</cfscript>
</cfsilent>


<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('programSchema')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">培养方案</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 collection"></i><cfoutput>#rs_subjectEntity.sbj_name#</cfoutput> - (<cfoutput>#rs_conditionEntity.grade#</cfoutput>)版
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">
				<div class="UItab">
					<div class="tabLables">
						<cfloop array="#termYearArray#" index="termYear">
							<span <cfif currentTab eq "labTermYear"&termYear>class="active"</cfif> id="labTermYear<cfoutput>#termYear#</cfoutput>" tabTarget="TermYear<cfoutput>#termYear#</cfoutput>"><cfoutput>#mathAdvice.convertTermYearToChinese(termYear)#</cfoutput></span>
						</cfloop>
						<span <cfif currentTab eq "labCondition">class="active"</cfif> id="labCondition" tabTarget="Condition">毕业条件</span>
						<span <cfif currentTab eq "labDegree">class="active"</cfif> id="labDegree" tabTarget="Degree">学位课</span>
                        <cfif rs_secDegree.recordCount>
						<span <cfif currentTab eq "labSecDegree">class="active"</cfif> id="labSecDegree" tabTarget="SecDegree">双学位课程</span>
						</cfif>
                        
                        <cfif rs_assistDegree.recordCount>
						<span <cfif currentTab eq "labAssistDegree">class="active"</cfif> id="labAssistDegree" tabTarget="AssistDegree">辅修课程</span>
						</cfif>
                        
						<span <cfif currentTab eq "labDelete">class="active"</cfif> id="labDelete" tabTarget="Delete">删除培养方案</span>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>
				
				<cfloop array="#termYearArray#" index="termYear">
					
					<cfset termIdxArray = mathAdvice.convertTermYearToSchemaTermIdxArray(termYear) />
                   
                    <cfset sql = "	SELECT
										DISTINCT s.term_index
									FROM
										t_schema s
									WHERE
										   s.grade = :grade 
										AND
										   s.term_index IN (:terms )
										AND
										   (s.sbj_id = :subjectID OR s.sbj_id LIKE :subjectDirs )
									ORDER BY
										s.term_index ASC">
                    
                    <cfset queryObj = new Query(datasource = application.dnsSlave)/>
                    <cfset queryObj.addParam(name="grade", value = event.getArg("Edition"), cfsqltype="cf_sql_char")/>
                    <cfset queryObj.addParam(name="terms", value = arrayToList(termIdxArray, ","), cfsqltype="cf_sql_char", list=true)/>
                    <cfset queryObj.addParam(name="subjectID", value = event.getArg("SubID"), cfsqltype="cf_sql_varchar")/>
                    <cfset queryObj.addParam(name="subjectDirs", value = event.getArg("SubID") & "_", cfsqltype="cf_sql_varchar")/>
                    <cfset rs_schemaTerm = queryObj.execute(sql=sql).getResult()/>
                    
                   
                    
					<div id="TermYear<cfoutput>#termYear#</cfoutput>" class="tabContent">
						
						<div class="noticeBlock">
							<div class="operation">
								<a class="uiButton uiButtonSpecial" href="<cfoutput>#buildURL('programSchemaDownloadExcel', targetArgs)#</cfoutput>"><i class="mrs img btnDownload"></i><span class="uiButtonText">下载培养方案</span></a>
							</div>
							<h3><cfoutput>#mathAdvice.convertTermYearToChinese(termYear)#</cfoutput></h3>
						</div>
						
						
                        <cfloop query="rs_schemaTerm">
							
							<cfset academicTermYear = mathAdvice.convertTermIdxToAcademicTermYear(rs_schemaTerm.term_index, rs_conditionEntity.grade, rs_subjectEntity.term_start) />
							
							<cfset structInsert(targetArgs, "Term", rs_schemaTerm.term_index, true) />
							
							<div class="noticeBlock">
								<h3><cfoutput>#academicTermYear[1]#</cfoutput>-<cfoutput>#academicTermYear[2]#</cfoutput>学期</h3>
								<p><span class="img icon16x16 message"></span>如需调整学期课程开设, 可以<a href="<cfoutput>#buildURL('programSchemaWizardCourseByTerm', targetArgs)#</cfoutput>">修订专业开课计划</a></p>
								<hr/>
							</div>
							
							<!--- 专业通用课程 --->
                            
                            <cfset sql = "	SELECT
												c.course_name,
												c.course_credit,
												i.institute_short,
												cp.prop_name,
												cn.cna_name,
												c.period_theory,
												c.period_practice,
												c.period_computer,
												c.course_code
											FROM
												t_schema s
												INNER JOIN t_course c ON c.cid = s.cid
												INNER JOIN t_institute i ON i.institute_id = c.institute_id
												INNER JOIN t_course_prop cp ON cp.prop_id = s.prop_id
												INNER JOIN t_course_nature cn ON cn.cna_id = s.cna_id
											WHERE
												s.grade = :grade 
												AND
												s.sbj_id = :subjectID 
												AND
												s.term_index = :term 
											ORDER BY
												cn.cna_name,cp.prop_name,c.course_name" />
                            
                            <cfset queryObj = new Query(datasource = application.dnsSlave)/>
							<cfset queryObj.addParam(name="grade", value=event.getArg("Edition"), cfsqltype="cf_sql_char")/>
                            <cfset queryObj.addParam(name="subjectID", value=event.getArg("SubID"), cfsqltype="cf_sql_varchar")/>
                            <cfset queryObj.addParam(name="term", value=rs_schemaTerm.term_index, cfsqltype="cf_sql_char")/>
                            <cfset rs_schema = queryObj.execute(sql=sql).getResult()/>
                            
                           
                            
							<cfset row = 0 />
							
							
                            <cfif rs_schema.recordCount>
								<table class="UIEditable">
									<thead>
										<tr>
											<td width="18"></td>
											<td width="48">类别</td>
											<td width="48">课程性质</td>
											<td width="70">课程号</td>
											<td>课程</td>
											<td width="24" align="right">理论</td>
											<td width="24" align="right">实践</td>
											<td width="24" align="right">上机</td>
											<td width="24" align="right">学分</td>
											<td width="48">开课学院</td>
										</tr>
									</thead>
									<tbody>
										
                                        <cfloop query="rs_schema">
											<cfset row++ />
											<tr class="editRows">
												<td><span class="index"><cfoutput>#row#</cfoutput></span></td>
												<td><cfoutput>#rs_schema.cna_name#</cfoutput></td>
												<td><cfoutput>#rs_schema.prop_name#</cfoutput></td>
												<td><span class="numeric"><cfoutput>#rs_schema.course_code#</cfoutput></span></td>
												<td><cfoutput>#rs_schema.course_name#</cfoutput></td>
												<td align="right"><cfif rs_schema.period_theory gt 0><span class="numeric"><cfoutput>#rs_schema.period_theory#</cfoutput></span></cfif></td>
												<td align="right"><cfif rs_schema.period_practice gt 0><span class="numeric"><cfoutput>#rs_schema.period_practice#</cfoutput></span></cfif></td>
												<td align="right"><cfif rs_schema.period_computer gt 0><span class="numeric"><cfoutput>#rs_schema.period_computer#</cfoutput></span></cfif></td>
												<td align="right"><span class="numeric"><cfoutput>#numberFormat(rs_schema.course_credit,'_._')#</cfoutput></span></td>
												<td align="right"><cfoutput>#rs_schema.institute_short#</cfoutput></td>
											</tr>
										</cfloop>
									</tbody>
								</table>
							</cfif>

							<!--- 专业方向课程 --->
                            <cfset sql = "	SELECT
												sbj.sbj_id,sbj.sbj_name,COUNT(*) r_count
											FROM
												t_schema s
												INNER JOIN t_subject sbj ON sbj.sbj_id = s.sbj_id
											WHERE
												s.grade = :grade 
												AND
												s.term_index = :term 
												AND
												s.sbj_id LIKE :subjectDirs 
											GROUP BY
												sbj.sbj_id,sbj.sbj_name
											ORDER BY
												sbj.sbj_name"/>

                            <cfset queryObj = new Query(datasource = application.dnsSlave)/>
							<cfset queryObj.addParam(name="grade", value=event.getArg("Edition"), cfsqltype="cf_sql_char")/>
                            <cfset queryObj.addParam(name="subjectDirs", value=event.getArg("SubID")&"_", cfsqltype="cf_sql_varchar")/>
                            <cfset queryObj.addParam(name="term", value=rs_schemaTerm.term_index, cfsqltype="cf_sql_char")/>
                            <cfset rs_dir = queryObj.execute(sql=sql).getResult()/>
                            
                            
                            
							<cfloop query="rs_dir">
								
								<div class="noticeBlock">
									<p><span class="img icon16x16 link"></span><cfoutput>#rs_dir.sbj_name#</cfoutput> 设课[<cfoutput>#rs_dir.r_count#</cfoutput>]门</p>
								</div>
                                <cfset sql = "	SELECT
													c.course_name,
													c.course_credit,
													i.institute_short,
													cp.prop_name,
													cn.cna_name,
													c.period_theory,
													c.period_practice,
													c.period_computer,
													c.course_code
												FROM
													t_schema s
													INNER JOIN t_course c ON c.cid = s.cid
													INNER JOIN t_institute i ON i.institute_id = c.institute_id
													INNER JOIN t_course_prop cp ON cp.prop_id = s.prop_id
													INNER JOIN t_course_nature cn ON cn.cna_id = s.cna_id
												WHERE
													s.grade = :grade 
													AND
													s.sbj_id = :subjectDir 
													AND
													s.term_index = :term 
												ORDER BY
													cn.cna_name,cp.prop_name,c.course_name" />
                                
								<cfset queryObj = new Query(datasource = application.dnsSlave)/>
                                <cfset queryObj.addParam(name="grade", value=event.getArg("Edition"), cfsqltype="cf_sql_char")/>
                                <cfset queryObj.addParam(name="subjectDir", value=rs_dir.sbj_id, cfsqltype="cf_sql_varchar")/>
                                <cfset queryObj.addParam(name="term", value=rs_schemaTerm.term_index, cfsqltype="cf_sql_char")/>
                                <cfset rs_schema = queryObj.execute(sql=sql).getResult()/>
                                
                                
								<cfset row = 0 />
							
								<cfif rs_schema.recordCount>
									<table class="UIEditable">
										<thead>
											<tr>
												<td width="18"></td>
												<td width="48">类别</td>
												<td width="48">课程性质</td>
												<td width="70">课程号</td>
												<td>课程</td>
												<td width="24" align="right">理论</td>
												<td width="24" align="right">实践</td>
												<td width="24" align="right">上机</td>
												<td width="24" align="right">学分</td>
												<td width="48">开课学院</td>
											</tr>
										</thead>
										<tbody>
                                            <cfloop query="rs_schema">
												<cfset row++ />
												<tr class="editRows">
													<td><span class="index"><cfoutput>#row#</cfoutput></span></td>
													<td><cfoutput>#rs_schema.cna_name#</cfoutput></td>
													<td><cfoutput>#rs_schema.prop_name#</cfoutput></td>
													<td><span class="numeric"><cfoutput>#rs_schema.course_code#</cfoutput></span></td>
													<td><cfoutput>#rs_schema.course_name#</cfoutput></td>
													<td align="right"><cfif rs_schema.period_theory gt 0><span class="numeric"><cfoutput>#rs_schema.period_theory#</cfoutput></span></cfif></td>
													<td align="right"><cfif rs_schema.period_practice gt 0><span class="numeric"><cfoutput>#rs_schema.period_practice#</cfoutput></span></cfif></td>
													<td align="right"><cfif rs_schema.period_computer gt 0><span class="numeric"><cfoutput>#rs_schema.period_computer#</cfoutput></span></cfif></td>
													<td align="right"><span class="numeric"><cfoutput>#numberFormat(rs_schema.course_credit,'_._')#</cfoutput></span></td>
													<td align="right"><cfoutput>#rs_schema.institute_short#</cfoutput></td>
												</tr>
											</cfloop>
										</tbody>
									</table>
								</cfif>
								
								
							</cfloop>
							
							
						</cfloop>
						
					</div>
					
				</cfloop>

				<cfset structDelete(targetArgs, "Term") />
				
				<div id="Condition" class="tabContent">
					
					<div class="noticeBlock">
						<h3><cfoutput>#rs_subjectEntity.sbj_name#</cfoutput>专业</h3>
						<p><span class="img icon16x16 subject"></span><cfoutput>#dictAdvice.getTermEnrol(rs_subjectEntity.term_start)#-#dictAdvice.getStudentLevel(rs_subjectEntity.level_code)#学生 一级学科: #rs_subjectEntity.learning_branch#</cfoutput></p>
						<hr/>
					</div>
					
					<div class="noticeBlock">
						<h3>学分要求</h3>
						<p><span class="img icon16x16 message"></span>如需对毕业生各项学分进行审核, 可以<a href="<cfoutput>#buildURL('programSchemaWizardCondition', targetArgs)#</cfoutput>">修订毕业学分学时要求</a></p>
						<cfif (rs_conditionEntity.credit + rs_conditionEntity.credit_required + rs_conditionEntity.credit_optional + rs_conditionEntity.credit_relish) gt 0>
						<p>毕业时必须达到如下条件</p>
						<ol>
							<cfif rs_conditionEntity.credit gt 0><li>总学分 <strong><cfoutput>#numberFormat(rs_conditionEntity.credit, "_._")#</cfoutput></strong></li></cfif>
							<cfif rs_conditionEntity.credit_required gt 0><li>必修课 <strong><cfoutput>#numberFormat(rs_conditionEntity.credit_required, "_._")#</cfoutput></strong></li></cfif>
							<cfif rs_conditionEntity.credit_optional gt 0><li>选修课 <strong><cfoutput>#numberFormat(rs_conditionEntity.credit_optional, "_._")#</cfoutput></strong></li></cfif>
							<cfif rs_conditionEntity.credit_relish gt 0><li>素质类通选课学分 <strong><cfoutput>#numberFormat(rs_conditionEntity.credit_relish, "_._")#</cfoutput></strong></li></cfif>
						</ol>
						<cfelse>
						<p><cfoutput>#rs_conditionEntity.grade#</cfoutput>级暂未设置毕业学分要求</p>
						</cfif>
					</div>
					
					<cfif (rs_conditionEntity.period + rs_conditionEntity.period_required + rs_conditionEntity.period_optional) gt 0>
					<div class="noticeBlock">
						<h3>修读学时要求</h3>
						<ol>
							<cfif rs_conditionEntity.period gt 0><li>总学时 <strong><cfoutput>#rs_conditionEntity.period#</cfoutput></strong></li></cfif>
							<cfif rs_conditionEntity.period_required gt 0><li>必修课 <strong><cfoutput>#rs_conditionEntity.period_required#</cfoutput></strong></li></cfif>
							<cfif rs_conditionEntity.period_optional gt 0><li>选修课 <strong><cfoutput>#rs_conditionEntity.period_optional#</cfoutput></strong></li></cfif>
						</ol>
					</div>
					</cfif>
					
				</div>
				<div id="Degree" class="tabContent">
					
					<cfset structInsert( targetArgs, "TabID", "labDegreeCourse", true ) />
					
					<div class="noticeBlock">
						<h3><cfoutput>#rs_subjectEntity.sbj_name#</cfoutput>专业</h3>
						<p><span class="img icon16x16 subject"></span>一级学科: <cfoutput>#rs_subjectEntity.learning_branch#</cfoutput>, 获取学位学生必须通过的课程. 如下述信息有误可以<a href="<cfoutput>#buildURL('programSchemaWizardCondition', targetArgs)#</cfoutput>">修订学位课程列表</a></p>
						<hr/>
					</div>
					
					<cfset structDelete(targetArgs, "TabID") />
					
					<cfif rs_subjectDegree.recordCount eq 0 >
						<div class="systemNotice">
							<p>尚未设置学位课程</p>
						</div>
					</cfif>
					
                    <cfloop query="rs_subjectDegree">
						
						<cfif rs_subjectDegree.sbj_id neq rs_subjectEntity.sbj_id >
							<div class="noticeBlock">
								<h3><cfoutput>#rs_subjectDegree.sbj_name#</cfoutput></h3>
							</div>
						</cfif>
						<cfset sql = "	SELECT
													c.course_name,
													c.course_credit,
													i.institute_short,
													cp.prop_name,
													cn.cna_name,
													c.period_theory,
													c.period_practice,
													c.period_computer,
													c.course_code
												FROM
													t_schema s
													INNER JOIN t_course c ON c.cid = s.cid
													INNER JOIN t_institute i ON i.institute_id = c.institute_id
													INNER JOIN t_course_prop cp ON cp.prop_id = s.prop_id
													INNER JOIN t_course_nature cn ON cn.cna_id = s.cna_id
												WHERE
													s.grade = :grade 
													AND
													s.sbj_id = :subjectDir 
													AND
														SUBSTR(s.shm_prop,1,1) = '1'
												ORDER BY
													cn.cna_name,cp.prop_name,c.course_name" />
                                
						<cfset queryObj = new Query(datasource = application.dnsSlave)/>
                        <cfset queryObj.addParam(name="grade", value = event.getArg("Edition"), cfsqltype="cf_sql_char")/>
                        <cfset queryObj.addParam(name="subjectDir", value = rs_subjectDegree.sbj_id, cfsqltype="cf_sql_varchar")/>
                        <cfset rs_schema = queryObj.execute(sql = sql).getResult()/>
                        
						<cfset row = 0 />
						
						<cfif rs_schema.recordCount>
						
							<table class="UIEditable">
								<thead>
									<tr>
										<td width="18"></td>
										<td width="48">类别</td>
										<td width="48">课程性质</td>
										<td width="70">课程号</td>
										<td>课程</td>
										<td width="24" align="right">理论</td>
										<td width="24" align="right">实践</td>
										<td width="24" align="right">上机</td>
										<td width="24" align="right">学分</td>
										<td width="48">开课学院</td>
									</tr>
								</thead>
								<tbody>
                                    <cfloop query="rs_schema">
										<cfset row++ />
										<tr class="editRows">
											<td><span class="index"><cfoutput>#row#</cfoutput></span></td>
											<td><cfoutput>#rs_schema.cna_name#</cfoutput></td>
											<td><cfoutput>#rs_schema.prop_name#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#rs_schema.course_code#</cfoutput></span></td>
											<td><cfoutput>#rs_schema.course_name#</cfoutput></td>
											<td align="right"><cfif rs_schema.period_theory gt 0><span class="numeric"><cfoutput>#rs_schema.period_theory#</cfoutput></span></cfif></td>
											<td align="right"><cfif rs_schema.period_practice gt 0><span class="numeric"><cfoutput>#rs_schema.period_practice#</cfoutput></span></cfif></td>
											<td align="right"><cfif rs_schema.period_computer gt 0><span class="numeric"><cfoutput>#rs_schema.period_computer#</cfoutput></span></cfif></td>
											<td align="right"><span class="numeric"><cfoutput>#numberFormat(rs_schema.course_credit,'_._')#</cfoutput></span></td>
											<td align="right"><cfoutput>#rs_schema.institute_short#</cfoutput></td>
										</tr>
									</cfloop>
								</tbody>
							</table>
						</cfif>
					</cfloop>
					
				</div>

                <cfif rs_secDegree.recordCount>
				<div id="SecDegree" class="tabContent">
					
					<cfset structInsert( targetArgs, "TabID", "labSecDegreeCourse", true ) />
					
					<div class="noticeBlock">
						<h3><cfoutput>#rs_subjectEntity.sbj_name#</cfoutput>专业</h3>
						<p><span class="img icon16x16 subject"></span>一级学科: <cfoutput>#rs_subjectEntity.learning_branch#</cfoutput>, 修读双学位学生必须通过的课程. 如下述信息有误可以<a href="<cfoutput>#buildURL('programSchemaWizardCondition', targetArgs)#</cfoutput>">修订双学位学位课程列表</a></p>
						<hr/>
					</div>
					
					<cfset structDelete(targetArgs, "TabID") />
					
					<cfif rs_secDegree.recordCount eq 0 >
						<div class="systemNotice">
							<p>尚未设置双学位课程</p>
						</div>
					</cfif>

					<cfloop query="rs_secDegree">
						<cfif rs_secDegree.sbj_id neq rs_subjectEntity.sbj_id >
							<div class="noticeBlock">
								<h3><cfoutput>#rs_secDegree.sbj_name#</cfoutput></h3>
							</div>
						</cfif>
						
                        
                        <cfset sql = "	SELECT
													c.course_name,
													c.course_credit,
													i.institute_short,
													cp.prop_name,
													cn.cna_name,
													c.period_theory,
													c.period_practice,
													c.period_computer,
													c.course_code
												FROM
													t_schema s
													INNER JOIN t_course c ON c.cid = s.cid
													INNER JOIN t_institute i ON i.institute_id = c.institute_id
													INNER JOIN t_course_prop cp ON cp.prop_id = s.prop_id
													INNER JOIN t_course_nature cn ON cn.cna_id = s.cna_id
												WHERE
													s.grade = :grade 
													AND
													s.sbj_id = :subjectDir 
													AND
														SUBSTR(s.shm_prop,2,1) = '1'
												ORDER BY
													cn.cna_name,cp.prop_name,c.course_name" />

						<cfset queryObj = new Query(datasource = application.dnsSlave)/>
                        <cfset queryObj.addParam(name="grade", value=event.getArg("Edition"), cfsqltype="cf_sql_char")/>
                        <cfset queryObj.addParam(name="subjectDir", value=rs_secDegree.sbj_id, cfsqltype="cf_sql_varchar")/>
                        <cfset rs_schema = queryObj.execute(sql = sql).getResult()/>
                        
						<cfset row = 0 />
						
						<cfif rs_schema.recordCount>
						
							<table class="UIEditable">
								<thead>
									<tr>
										<td width="18"></td>
										<td width="48">类别</td>
										<td width="48">课程性质</td>
										<td width="70">课程号</td>
										<td>课程</td>
										<td width="24" align="right">理论</td>
										<td width="24" align="right">实践</td>
										<td width="24" align="right">上机</td>
										<td width="24" align="right">学分</td>
										<td width="48">开课学院</td>
									</tr>
								</thead>
								<tbody>
                                    <cfloop query="rs_schema">
										<cfset row++ />
                                        <tr class="editRows">
											<td><span class="index"><cfoutput>#row#</cfoutput></span></td>
											<td><cfoutput>#rs_schema.cna_name#</cfoutput></td>
											<td><cfoutput>#rs_schema.prop_name#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#rs_schema.course_code#</cfoutput></span></td>
											<td><cfoutput>#rs_schema.course_name#</cfoutput></td>
											<td align="right"><cfif rs_schema.period_theory gt 0><span class="numeric"><cfoutput>#rs_schema.period_theory#</cfoutput></span></cfif></td>
											<td align="right"><cfif rs_schema.period_practice gt 0><span class="numeric"><cfoutput>#rs_schema.period_practice#</cfoutput></span></cfif></td>
											<td align="right"><cfif rs_schema.period_computer gt 0><span class="numeric"><cfoutput>#rs_schema.period_computer#</cfoutput></span></cfif></td>
											<td align="right"><span class="numeric"><cfoutput>#numberFormat(rs_schema.course_credit,'_._')#</cfoutput></span></td>
											<td align="right"><cfoutput>#rs_schema.institute_short#</cfoutput></td>
										</tr>
									</cfloop>
								</tbody>
							</table>
						</cfif>
					</cfloop>
					
				</div>
				</cfif>
                
                <cfif rs_assistDegree.recordCount>
				<div id="AssistDegree" class="tabContent">
					
					<cfset structInsert( targetArgs, "TabID", "labAssistCourse", true ) />
					
					<div class="noticeBlock">
						<h3><cfoutput>#rs_subjectEntity.sbj_name#</cfoutput>专业</h3>
						<p><span class="img icon16x16 subject"></span>一级学科: <cfoutput>#rs_subjectEntity.learning_branch#</cfoutput>, 修读辅修的学生必须通过的课程. 如下述信息有误可以<a href="<cfoutput>#buildURL('programSchemaWizardCondition', targetArgs)#</cfoutput>">修订辅修程列表</a></p>
						<hr/>
					</div>

					<cfset structDelete(targetArgs, "TabID") />

					<cfif rs_assistDegree.recordCount eq 0 >
						<div class="systemNotice">
							<p>尚未设置辅修课程</p>
						</div>
					</cfif>
					

					<cfloop query="rs_assistDegree">
                    	<cfif rs_assistDegree.sbj_id neq rs_subjectEntity.sbj_id >
							<div class="noticeBlock">
								<h3><cfoutput>#rs_assistDegree.sbj_name#</cfoutput></h3>
							</div>
						</cfif>
                       
                        <cfset sql = "	SELECT
													c.course_name,
													c.course_credit,
													i.institute_short,
													cp.prop_name,
													cn.cna_name,
													c.period_theory,
													c.period_practice,
													c.period_computer,
													c.course_code
												FROM
													t_schema s
													INNER JOIN t_course c ON c.cid = s.cid
													INNER JOIN t_institute i ON i.institute_id = c.institute_id
													INNER JOIN t_course_prop cp ON cp.prop_id = s.prop_id
													INNER JOIN t_course_nature cn ON cn.cna_id = s.cna_id
												WHERE
													s.grade = :grade 
													AND
													s.sbj_id = :subjectDir 
													AND
														SUBSTR(s.shm_prop,3,1) = '1'
												ORDER BY
													cn.cna_name,cp.prop_name,c.course_name" />

						<cfset queryObj = new Query(datasource = application.dnsSlave)/>
                        <cfset queryObj.addParam(name="grade", value=event.getArg("Edition"), cfsqltype="cf_sql_char")/>
                        <cfset queryObj.addParam(name="subjectDir", value=rs_assistDegree.sbj_id, cfsqltype="cf_sql_varchar")/>
                        <cfset rs_schema = queryObj.execute(sql = sql).getResult()/>
                        
						<cfset row = 0 />
						
						<cfif rs_schema.recordCount>
						
							<table class="UIEditable">
								<thead>
									<tr>
										<td width="18"></td>
										<td width="48">类别</td>
										<td width="48">课程性质</td>
										<td width="70">课程号</td>
										<td>课程</td>
										<td width="24" align="right">理论</td>
										<td width="24" align="right">实践</td>
										<td width="24" align="right">上机</td>
										<td width="24" align="right">学分</td>
										<td width="48">开课学院</td>
									</tr>
								</thead>
								<tbody>
                                    <cfloop query="rs_schema">
										<cfset row++ />
                                        <tr class="editRows">
											<td><span class="index"><cfoutput>#row#</cfoutput></span></td>
											<td><cfoutput>#rs_schema.cna_name#</cfoutput></td>
											<td><cfoutput>#rs_schema.prop_name#</cfoutput></td>
											<td><span class="numeric"><cfoutput>#rs_schema.course_code#</cfoutput></span></td>
											<td><cfoutput>#rs_schema.course_name#</cfoutput></td>
											<td align="right"><cfif rs_schema.period_theory gt 0><span class="numeric"><cfoutput>#rs_schema.period_theory#</cfoutput></span></cfif></td>
											<td align="right"><cfif rs_schema.period_practice gt 0><span class="numeric"><cfoutput>#rs_schema.period_practice#</cfoutput></span></cfif></td>
											<td align="right"><cfif rs_schema.period_computer gt 0><span class="numeric"><cfoutput>#rs_schema.period_computer#</cfoutput></span></cfif></td>
											<td align="right"><span class="numeric"><cfoutput>#numberFormat(rs_schema.course_credit,'_._')#</cfoutput></span></td>
											<td align="right"><cfoutput>#rs_schema.institute_short#</cfoutput></td>
										</tr>
									</cfloop>
								</tbody>
							</table>
						</cfif>
					</cfloop>
					
				</div>
				</cfif>
                
                
				<div id="Delete" class="tabContent">
					
					<div class="systemNotice">
						<h3><span class="img icon16x16 info"></span>删除培养方案</h3>
						<p>注意: 删除培养方案的同时, 会同时删除该专业对应年级的双学位、辅修、毕业条件、学费收缴等相关信息. </p>
						
						<form id="formRemove" class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('schemaRemoveDo')#</cfoutput>">
							<input type="hidden" name="Edition" value="<cfoutput>#event.getArg('Edition')#</cfoutput>" />
							<input type="hidden" name="SubjectID" value="<cfoutput>#event.getArg('SubID')#</cfoutput>" />
							<div class="lable"><input class="button2" type="submit" value="删除培养方案" /></div>
						</form>
						
					</div>
					
				</div>


			</div>
		</li>
	</ul>
</div>